import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页'},

                },

                {
                    path: '/table',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/BaseTable.vue'),
                    meta: { title: '订单情况' }
                },
                {
                    path: '/message',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/Message.vue'),
                    meta: { title: '买家留言' }
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: () => import(/* webpackChunkName: "chart" */ '../components/page/BaseCharts.vue'),
                    meta: { title: '销售情况' }
                },

                {
                    // 拖拽Dialog组件
                    path: '/editAccount',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/EditAccount.vue'),
                    meta: { title: '管理员信息' }
                },
                {

                    path: '/editProduct',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/EditProduct.vue'),
                    meta: { title: '商品信息' }
                },
                {

                    path: '/editUser',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/EditUser.vue'),
                    meta: { title: '用户信息' }
                },

                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                    meta: { title: '权限测试', permission: true }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },

            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/Account/Login.vue'),
            meta: { title: '登录' }
        },

        {
            path: '*',
            redirect: '/404'
        }
    ]
});



